<!--  -->
<template>
    <div class='chart_index'>
    <!-- chart_data转换好的图表数据 -->
      <chart :chart_data='chart_data'></chart>
      <div @click='data_file'>
        点击改变图表名
      </div>
  </div>
</template>

<script>
import { dataformat } from "@/utils/utiltoo";
import * as echarts from "echarts";
import chart from './chart.vue'
import default_value from './value'
export default {
  data () {
    return {
      chart_data:'',
      show:false,
      num:0,
    };
  },

  components: {
      chart
  },

  computed: {},

  mounted(){
    let obj = _.cloneDeep(dataformat(default_value).content[0][1].option);
    this.chart_data = obj;
    this.show = true;
  },

  methods: {
    data_file(){
      this.chart_data.title.text=`${this.num++}编辑过的`
    }
  }
}

</script>
<style lang='scss' scoped>
.chart_index{
  width: 100%;
  height: 600px;
  display: flex;
  justify-content: center;
}
</style>